package com.echo.entity;

import java.util.Date;

public class User {
    private Integer id;         // 数据库主键（自增）
    private String username;    // 登录用户名（唯一）
    private String password;    // 加密后的密码
    private String email;       // 邮箱（唯一）
    private String nickname;    // 昵称（可修改）
    private String avatar;      // 头像URL（可选）
    private Date createTime;    // 创建时间（包含日期和时间）
    private Integer status;     // 状态（1正常/0禁用）
    private Integer role;       // 角色（0普通/1管理员）

    public User() {
    }

    public User(Integer id, String username, String password, String email, String nickname, String avatar, Date createTime, Integer status, Integer role) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.email = email;
        this.nickname = nickname;
        this.avatar = avatar;
        this.createTime = createTime;
        this.status = status;
        this.role = role;
    }

    // 生成getter/setter方法
    public Integer getId() {
        return id;
    }
    public void setId(Integer id) {
        this.id = id;
    }
    public String getUsername() {
        return username;
    }
    public void setUsername(String username) {
        this.username = username;
    }
    public String getPassword() {
        return password;
    }
    public void setPassword(String password) {
        this.password = password;
    }
    public String getEmail() {
        return email;
    }
    public void setEmail(String email) {
        this.email = email;
    }
    public String getNickname() {
        return nickname;
    }
    public void setNickname(String nickname) {
        this.nickname = nickname;
    }
    public String getAvatar() {
        return avatar;
    }
    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
    public Integer getRole() {
        return role;
    }
    public void setRole(Integer role) {
        this.role = role;
    }
    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", email='" + email + '\'' +
                ", nickname='" + nickname + '\'' +
                ", avatar='" + avatar + '\'' +
                ", createTime=" + createTime +
                ", status=" + status +
                ", role=" + role +
                '}';
    }

}